package com.ems.util;

public enum BMSEnum {

    //BMS故障
    ALARM_CHARGE_3_LEVEL_HIGH(166, "充电-总压高 3级报警"),
    ALARM_CHARGE_3_LEVEL_LOW(167, "充电-总压低 3级报警"),
    ALARM_CHARGE_3_LEVEL_SINGLE_HIGH(168, "充电-单体高 3级报警"),
    ALARM_CHARGE_3_LEVEL_SINGLE_LOW(169, "充电-单体低 3级报警"),
    ALARM_CHARGE_3_LEVEL_SINGLE_DIFF(170, "充电-单体压差大 3级报警"),
    ALARM_CHARGE_3_LEVEL_TEMP_HIGH(171, "充电-温度高 3级报警"),
    ALARM_CHARGE_3_LEVEL_TEMP_LOW(172, "充电-温度低 3级报警"),
    ALARM_CHARGE_3_LEVEL_TEMP_DIFF(173, "充电-温差大 3级报警"),
    ALARM_CHARGE_3_LEVEL_TEMP_OVER_CURRENT(174, "充电-过流 3级报警"),
    ALARM_DIS_CHARGE_3_LEVEL_HIGH(175, "放电-总压高 3级报警"),
    ALARM_DIS_CHARGE_3_LEVEL_LOW(176, "放电-总压低 3级报警"),
    ALARM_DIS_CHARGE_3_LEVEL_SINGLE_HIGH(177, "放电-单体高 3级报警"),
    ALARM_DIS_CHARGE_3_LEVEL_SINGLE_LOW(178, "放电-单体低 3级报警"),
    ALARM_DIS_CHARGE_3_LEVEL_SINGLE_DIFF(179, "放电-单体压差大 3级报警"),
    ALARM_DIS_CHARGE_3_LEVEL_TEMP_HIGH(180, "放电-温度高 3级报警"),
    ALARM_DIS_CHARGE_3_LEVEL_TEMP_LOW(181, "放电-温度低 3级报警"),
    ALARM_DIS_CHARGE_3_LEVEL_TEMP_DIFF(182, "放电-温差大 3级报警"),
    ALARM_DIS_CHARGE_3_LEVEL_OVER_CURRENT(183, "放电-过流 3级报警"),
    ALARM_SOC_LOW_3_LEVEL(184, "SOC过低 3级报警"),
    ALARM_INSULATION_FAULT_3_LEVEL(185, "绝缘故障 3级报警"),
    ALARM_CHARGE_2_LEVEL_HIGH(186, "充电-总压高 2级报警"),
    ALARM_CHARGE_2_LEVEL_LOW(187, "充电-总压低 2级报警"),
    ALARM_CHARGE_2_LEVEL_SINGLE_HIGH(188, "充电-单体高 2级报警"),
    ALARM_CHARGE_2_LEVEL_SINGLE_LOW(189, "充电-单体低 2级报警"),
    ALARM_CHARGE_2_LEVEL_SINGLE_DIFF(190, "充电-单体压差大 2级报警"),
    ALARM_CHARGE_2_LEVEL_TEMP_HIGH(191, "充电-温度高 2级报警"),
    ALARM_CHARGE_2_LEVEL_TEMP_LOW(192, "充电-温度低 2级报警"),
    ALARM_CHARGE_2_LEVEL_TEMP_DIFF(193, "充电-温差大 2级报警"),
    ALARM_CHARGE_2_LEVEL_TEMP_OVER_CURRENT(194, "充电-过流 2级报警"),
    ALARM_DIS_CHARGE_2_LEVEL_HIGH(195, "放电-总压高 2级报警"),
    ALARM_DIS_CHARGE_2_LEVEL_LOW(196, "放电-总压低 2级报警"),
    ALARM_DIS_CHARGE_2_LEVEL_SINGLE_HIGH(197, "放电-单体高 2级报警"),
    ALARM_DIS_CHARGE_2_LEVEL_SINGLE_LOW(198, "放电-单体低 2级报警"),
    ALARM_DIS_CHARGE_2_LEVEL_SINGLE_DIFF(199, "放电-单体压差大 2级报警"),
    ALARM_DIS_CHARGE_2_LEVEL_TEMP_HIGH(200, "放电-温度高 2级报警"),
    ALARM_DIS_CHARGE_2_LEVEL_TEMP_LOW(201, "放电-温度低 2级报警"),
    ALARM_DIS_CHARGE_2_LEVEL_TEMP_DIFF(202, "放电-温差大 2级报警"),
    ALARM_DIS_CHARGE_2_LEVEL_OVER_CURRENT(203, "放电-过流 2级报警"),
    ALARM_SOC_LOW_2_LEVEL(204, "SOC过低 2级报警"),
    ALARM_INSULATION_FAULT_2_LEVEL(205, "绝缘故障 2级报警"),
    ALARM_CHARGE_1_LEVEL_HIGH(206, "充电-总压高 1级报警"),
    ALARM_CHARGE_1_LEVEL_LOW(207, "充电-总压低 1级报警"),
    ALARM_CHARGE_1_LEVEL_SINGLE_HIGH(208, "充电-单体高 1级报警"),
    ALARM_CHARGE_1_LEVEL_SINGLE_LOW(209, "充电-单体低 1级报警"),
    ALARM_CHARGE_1_LEVEL_SINGLE_DIFF(210, "充电-单体压差大 1级报警"),
    ALARM_CHARGE_1_LEVEL_TEMP_HIGH(211, "充电-温度高 1级报警"),
    ALARM_CHARGE_1_LEVEL_TEMP_LOW(212, "充电-温度低 1级报警"),
    ALARM_CHARGE_1_LEVEL_TEMP_DIFF(213, "充电-温差大 1级报警"),
    ALARM_CHARGE_1_LEVEL_TEMP_OVER_CURRENT(214, "充电-过流 1级报警"),
    ALARM_DIS_CHARGE_1_LEVEL_HIGH(215, "放电-总压高 1级报警"),
    ALARM_DIS_CHARGE_1_LEVEL_LOW(216, "放电-总压低 1级报警"),
    ALARM_DIS_CHARGE_1_LEVEL_SINGLE_HIGH(217, "放电-单体高 1级报警"),
    ALARM_DIS_CHARGE_1_LEVEL_SINGLE_LOW(218, "放电-单体低 1级报警"),
    ALARM_DIS_CHARGE_1_LEVEL_SINGLE_DIFF(219, "放电-单体压差大 1级报警"),
    ALARM_DIS_CHARGE_1_LEVEL_TEMP_HIGH(220, "放电-温度高 1级报警"),
    ALARM_DIS_CHARGE_1_LEVEL_TEMP_LOW(221, "放电-温度低 1级报警"),
    ALARM_DIS_CHARGE_1_LEVEL_TEMP_DIFF(222, "放电-温差大 1级报警"),
    ALARM_DIS_CHARGE_1_LEVEL_OVER_CURRENT(223, "放电-过流 1级报警"),
    ALARM_SOC_LOW_1_LEVEL(224, "SOC过低 1级报警"),
    ALARM_INSULATION_FAULT_1_LEVEL(225, "绝缘故障 1级报警")
    ;


    // 错误警告码
    private Integer code;
    // 错误警告标题
    private String title;

    BMSEnum(Integer code, String title) {
        this.code = code;
        this.title = title;
    }


    public static String getTitle(Integer code) {
        BMSEnum[] bmsEnums = values();
        for (BMSEnum bmsEnum : bmsEnums) {
            if (bmsEnum.getCode() == code) {
                return bmsEnum.getTitle();
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

}
